package com.mars.btrace.demo;

import com.sun.btrace.AnyType;
import com.sun.btrace.BTraceUtils;
import com.sun.btrace.annotations.BTrace;
import com.sun.btrace.annotations.OnMethod;
import com.sun.btrace.annotations.ProbeClassName;
import com.sun.btrace.annotations.ProbeMethodName;

/**
 * author by: mars
 * Date: 2019/5/25 22:56
 * Description: 拦截同名函数
 */
@BTrace
public class BtraceDemo3 {

    @OnMethod(
            clazz = "com.mars.btrace.controller.UserController",
            method = "same"
    )
    public static void getSameMethod(@ProbeClassName String pcn,
                                    @ProbeMethodName String pmn,
                                    String name,String hobby){
        BTraceUtils.println(pcn+","+pmn);
        BTraceUtils.println(name + "," + hobby);
        BTraceUtils.println();
    }
}
